import pyautogui as gui
import time
import keyboard as key
import sys
gui.doubleClick(50,300)#跳转桌面
time.sleep(1)
gui.doubleClick(50,300)#点击开始
time.sleep(7)
gui.click(1405,800)#开始游戏1
time.sleep(15)
gui.doubleClick(270,960)#开始游戏2
time.sleep(1)
gui.doubleClick(480,367)#第一个游戏
time.sleep(3)
gui.click(1043,743)#进入游戏
time.sleep(83)
gui.moveTo(400,400)#唤醒鼠标
time.sleep(0.3)
gui.doubleClick(987,386)#点击回到游戏
time.sleep(0.3)
gui.click(400,400,button="right")#打开图标
time.sleep(0.3)
gui.click(957,470)#进入一区
time.sleep(30)
gui.press('1')#切换主武魂
time.sleep(0.1)
gui.press('esc')#呼出菜单
time.sleep(1)
gui.click(960,570)#点击组队
time.sleep(1)
gui.click(600,875)#点击创建副本
time.sleep(1)
gui.click(1200,935)#点击选择副本
time.sleep(1)
gui.click(800,770)#点击每日副本
time.sleep(1)
gui.click(800,560)#点击对应难度
time.sleep(1)
gui.click(1107,196)#点击返回
time.sleep(1)
gui.click(1188,897)#点击开始
time.sleep(3)
i=0
while(i<=100):
    i+=1
    gui.click(970.577)#攻击
    time.sleep(0.1)
time.sleep(20)
gui.press('o')
time.sleep(2)
gui.press('esc')#呼出菜单
time.sleep(1)
gui.click(960,570)#点击组队
time.sleep(1)
gui.click(600,875)#点击创建副本
time.sleep(1)
gui.click(1200,935)#点击选择副本
time.sleep(1)
gui.click(800,770)#点击每日副本
time.sleep(1)
gui.click(875,560)#点击对应难度
time.sleep(1)
gui.click(1107,196)#点击返回
time.sleep(1)
gui.click(1188,897)#点击开始
time.sleep(3)

i=0
while(i<=100):
    i+=1
    gui.click(970.577)#攻击
    time.sleep(0.3)
time.sleep(20)
gui.press('o')
time.sleep(2)
gui.click(960,570)#点击组队
time.sleep(1)
gui.click(600,875)#点击创建副本
time.sleep(1)
gui.click(1200,935)#点击选择副本
time.sleep(1)
gui.click(800,770)#点击每日副本
time.sleep(1)
gui.click(950,560)#点击对应难度
time.sleep(1)
gui.click(1107,196)#点击返回
time.sleep(1)
gui.click(1188,897)#点击开始
time.sleep(3)
i=0
while(i<=100):
    i+=1
    gui.click(970.577)#攻击
    time.sleep(0.1)
time.sleep(20)
gui.press('o')
time.sleep(2)
time.sleep(2)
gui.click(960,570)#点击组队
time.sleep(1)
gui.click(600,875)#点击创建副本
time.sleep(1)
gui.click(1200,935)#点击选择副本
time.sleep(1)
gui.click(800,770)#点击每日副本
time.sleep(1)
gui.click(1025,560)#点击对应难度
time.sleep(1)
gui.click(1107,196)#点击返回
time.sleep(1)
gui.click(1188,897)#点击开始
time.sleep(3)
t=gui.screenshot("target.png")
while(t==None):
    i+=1
    gui.click(970.577)#攻击
    time.sleep(0.1)
gui.press('o')
time.sleep(2)
print("已经挂完每日任务!!!")
